﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ElisaHippo.Properties;

namespace ElisaHippo
{
    /// <summary>
    /// Interaction logic for SelInput.xaml
    /// </summary>
    public partial class SelInput : Window
    {
        bool bOk = false;
        string selMode = "";
        public SelInput()
        {
            InitializeComponent();
            lblVersion.Content = stringRes.version;
            this.Closed += new EventHandler(SelInput_Closed);
        }


        void SelInput_Closed(object sender, EventArgs e)
        {
        
            Utility.WriteExecuteResult(bOk);
            Utility.WriteSelectionResult(selMode);

            
        }

        private void btnMannual_Click(object sender, RoutedEventArgs e)
        {
            FinishSelection(stringRes.mannualMode);
         
        }
        private void btnScanGun_Click(object sender, RoutedEventArgs e)
        {
            FinishSelection(stringRes.scanGunMode);
        }

        private void btnPosID_Click(object sender, RoutedEventArgs e)
        {
            FinishSelection(stringRes.posIDMode);
        }
        private void FinishSelection(string mode)
        {
            selMode = mode;
            bOk = true;
            this.Close();
        }
    }
}
